HTMLify
Valid Anagram.cpp(sorting Approch)
Views: 1 | Author: cody
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include<bits/stdc++.h>
using namespace std;
bool isAnagram(string str1, string str2)
{
//Write your code here
// vector<string>v =str1;
sort(str1.begin(), str1.end());
sort(str2.begin(), str2.end());
if(str1 == str2) return true;
return false;
}
|